<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<TblCheckData> list = (List<TblCheckData>)request.getAttribute("list");
	CheckDataForm form = (CheckDataForm)request.getAttribute("command");
%>
<div class="main">
	<div class="oaTable">
	    <div class="toolPannel">
            	<div class="box">
                    <div>
						-年-月：
						<input  type="text" style="width:60px;height: 22px;" id="year_month" value="<%=StringUtils.isNotBlank(form.getYear_month())?form.getYear_month():"" %>" name="year_month" onClick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM',maxDate:'%y-%M'})">
					</div>
					<div>所属公司：
						<select id="siteid" class="easyui-combobox" name="siteid" style="width:120px;"></select>
					</div>	
                    <div>部门：
						<select id="deptid" class="easyui-combobox" name="deptid" style="width:100px;"></select>
					</div>
                    <div>工号：
						<input id="userid" style="height: 22px;" type="text" name="userid" class="search" value="<%=StringUtils.isNotBlank(form.getUserid())?form.getUserid():""%>"
							placeholder="请输入员工编号"/>
						<input type="button" class="searchSubmit" style="height: 24px;" onclick="javascript:XF.Check.dataListSearch()" value="搜索"/>
						<input class="searchSubmit" type="button" style="width:80px;height: 24px;"  onclick="javascript:XF.Check.checkExport()" value="导出Excel"/>
					</div>
				</div>
            </div>
<table class="tableList">

	<tbody>
		<tr id="tableHeader">
			<th style="width: 14%">工号</th>
			<th style="width: 10%">姓名</th>
			<th style="width: 14%">所属公司</th>
			<th style="width: 10%">部门</th>
			<th style="width: 10%">职位</th>
			<th style="width: 15%">打卡日期</th>
			<th style="width: 15%">打卡时间</th>
		</tr>
		<%
			if (list != null && list.size() > 0) {
				for (TblCheckData data: list) {
		%>
						<tr>
							<td><%=data.getUserid() %></td>
							<td><%=data.getUsername()!=null?data.getUsername():"" %></td>
							<td><%=data.getSitename() %></td>
							<td><%=data.getDeptname()%></td>
							<td><%=data.getPostname()!=null?data.getPostname():""%></td>
							<td><%=DateFormatUtils.format(data.getCheckdate(), "yyyy-MM-dd") %></td>
							<td><%=data.getChecktimes() %></td>
						</tr>
					<%
				}
			}
		
		%>
		        
        		<tr id="tableFooter">
			<td colspan="8">
				<div class="pagination">
					<monggoTag:pagination href="data_search"
						pageSize="<%=form.getPageSize()%>"
						totalRecord="<%=form.getTotalRecord() %>"
						currentPage="<%=form.getPageNum() %>">
					</monggoTag:pagination>
				</div>
			</td>
		</tr>
	</tbody>
</table>
</div>
</div>
<script>
var siteid = '<%=form.getSiteid() %>';
var deptid = '<%=form.getDeptid() %>';
$('#siteid').combobox({
	url:global.contextPath + '/company/siteList',
	valueField:'siteid',
	textField:'sitename',
	onSelect:function(record){
		$('#deptid').combobox('clear'); //清除原来的数据  
        var url = global.contextPath + '/company/datagridDepts?siteid=' + record.siteid;  
    	$('#deptid').combobox('reload', url);//联动下拉列表重载 
    },
    panelHeight: '300'
});
$('#deptid').combobox({
	valueField:'deptid',
	textField:'deptname',								
	url:global.contextPath + '/company/datagridDepts?siteid=' + siteid,
	panelHeight: '300'
});
$('#siteid').combobox('setValue', siteid);
</script>